<?php

namespace Model\UserBundle\Controller;

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;

use Symfony\Component\HttpFoundation\Request;
use Base\BaseController;
use Model\UserBundle\Setting\UserLoginLogSetting;

/**
 * @route("/admin/")
 */
class UserLoginLogAdminController extends BaseController
{

    /**
     * @route("UserLoginLog/add",name="UserLoginLogPreAdd")
     */
    public function add()
    {
        return $this->js_out("用户记录不允许手动添加");
    }

    /**
     * @route("UserLoginLog",name="UserLoginLogLists")
     */
    public function lists()
    {
        //私有
        $tools = array("passwordError"    => array(array("id"=>1,"name"=>"密码异常"),array("id"=>0,"name"=>"正常")));

        //通用部分
        $this->setSetting(new UserLoginLogSetting($this->getDoctrine()->getManager()));
        return $this->comLists($tools);
    }

    /**
     * @route("UserLoginLog/tools",name="UserLoginLogTools")
     */
    public function tools(Request $request)
    {
        $this->setSetting(new UserLoginLogSetting($this->getDoctrine()));
        return $this->comTools($request);
    }

}
